#ifndef CTABS_H
#define CTABS_H


#include "cControl.h"

#include <commctrl.h>
#include <vector>
class cTabs;

typedef struct tagTCITEMHEADER {
  UINT   mask;
  UINT   lpReserved1;
  UINT   lpReserved2;
  LPTSTR pszText;
  int    cchTextMax;
  int    iImage;
} TCITEMHEADER, *LPTCITEMHEADER;

class cOnglet
{
    public :
        cOnglet(cTabs * tabctlparent,int id)
        {
            tabId=id;
            controlParent=tabctlparent;
        }

        cHwnd *     conteneur;
        COLORREF    couleur;

        // getters
        bool        GetEnable()                 {return this->enabled;}
        string      GetLabel()                  {return this->libelle;}
        int         GetTabId()                  {return this->tabId;}

        // setters
        void        SetEnable(bool enabled);
        void        SetLabel(string label);
        void        SetTabId(int _tabId)        {this->tabId=_tabId;}


    private :
        bool        enabled;
        string      libelle;
        int         tabId;

        cTabs *     controlParent;

};

struct TAB_INFO{
    TCITEMHEADER header;
    cOnglet * more;
};

class cTabs : public cControl
{
    public:
        cTabs(cHwnd * hwndParent,int x,int y,int largeur,int hauteur);
        ~cTabs();
        cOnglet *     addTab(string libelle);
        vector<cOnglet*>    onglets;

    protected:

    private:
        bool        TraitementEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam,LRESULT & resultat);
        int         ancienOnglet;
        int         itemhighted;

};

#endif // CTABS_H
